<?php
    $aProductSettingsTemp = $template->get('aSettings');
?>

<div class="admin_header_title">SETTINGS ADD PRODUCT</div>
<?php
    if($template->get('aErrors'))
    {
        foreach($template->get('aErrors') as $sError)
        {
            echo '<div class="metro_message_error"><i class="fa fa-exclamation-triangle"></i> '.$sError.'</div>';
        }
    }
    else
    {
        if($template->get('bIsUpdate'))
        {
            echo '<div class="metro_message_susscess"><i class="fa fa-check"></i> Update Susscessful!</div>';
        }
    }
?>

<div class="metro_table green_metro_style">
    <div class="metro_table_title"><i class="fa fa-bars"></i> Add product settings</div>
    <div class="metro_table_content">
        <form action="" method="POST">
            <div style="margin-top:10px;">
                <input type="text" disabled value="User" style="width: 150px;margin-right: -10px;">
                <?php
                    $aParamLocation = array(
                        'width' => '400px',
                        'id' =>'tb_user',
                        'aValue' => DBObject::getUsers(),
                        'stringTitle' => 'name',
                        'stringKey' => 'uri',
                        'title' => isset($aProductSettingsTemp['default_user_add_product']) ? $aProductSettingsTemp['default_user_add_product']['setting_value'] : '',
                        'value' => isset($aProductSettingsTemp['default_user_add_product']) ? $aProductSettingsTemp['default_user_add_product']['setting_key'] : '',

                    );
                    includeBlock('block/customComboboxBlock',$aParamLocation);
                ?>
            </div>
            <div style="margin-top:10px;">
                <input type="text" disabled value="Menufacturer" style="width: 150px;margin-right: -10px;">
                <?php
                    $aParamLocation = array(
                        'width' => '400px',
                        'id' =>'tb_menufacturer',
                        'aValue' => DBObject::getManufacturers(),
                        'stringTitle' => 'name',
                        'stringKey' => 'uri',
                        'title' => isset($aProductSettingsTemp['default_menufacturer_add_product']) ? $aProductSettingsTemp['default_menufacturer_add_product']['setting_value'] : '',
                        'value' => isset($aProductSettingsTemp['default_menufacturer_add_product']) ? $aProductSettingsTemp['default_menufacturer_add_product']['setting_key'] : '',
                    );
                    includeBlock('block/customComboboxBlock',$aParamLocation);
                ?>
            </div>
            <div style="margin-top:10px;">
                <?php 
                    $aParams = array(
                        'width' => '568px',
                        'category_name' => isset($aProductSettingsTemp['default_category_add_product']) ? $aProductSettingsTemp['default_category_add_product']['setting_value'] : '',
                        'category_uri' => isset($aProductSettingsTemp['default_category_add_product']) ? $aProductSettingsTemp['default_category_add_product']['setting_key'] : '',
                        'list_categories' => isset($aProductSettingsTemp['default_category_add_product']) ? $aProductSettingsTemp['default_category_add_product']['description'] : '',
                    );
                    includeBlock('block/categoryBlock' , $aParams);
                ?>
            </div>
            <div style="margin-top:10px;">
                <input type="text" disabled value="Location" style="width: 150px;margin-right: -10px;">
                <?php
                    $aParamLocation = array(
                        'width' => '400px',
                        'id' =>'tb_location',
                        'aValue' => DBObject::getLocations(),
                        'stringTitle' => 'name',
                        'stringKey' => 'name',
                        'title' => isset($aProductSettingsTemp['default_location_add_product']) ? $aProductSettingsTemp['default_location_add_product']['setting_value'] : '',
                        'value' => isset($aProductSettingsTemp['default_location_add_product']) ? $aProductSettingsTemp['default_location_add_product']['setting_key'] : '',
                    );
                    includeBlock('block/customComboboxBlock',$aParamLocation);
                ?>
            </div>
            <div style="margin-top:10px;">
                <input type="text" disabled value="Number image" style="width: 150px;margin-right: -10px;">
                <input type="text" name="tb_number_image" style="width: 426px;" value="<?php echo $aProductSettingsTemp['default_number_image_download']['setting_value'] ;?>">
            </div> 

            <div style="margin-top:10px;">
                <input type="text" disabled value="Status add product" style="width: 150px;margin-right: -10px;">
                <?php
                    $aStatusParams = array(
                        'width' => '400px',
                        'id' =>'tb_status_add_product',
                        'aValue' => array('Manual','Auto'),
                        'title' => isset($aProductSettingsTemp['default_status_add_product']) ? $aProductSettingsTemp['default_status_add_product']['setting_value'] : '',
                        'value' => isset($aProductSettingsTemp['default_status_add_product']) ? $aProductSettingsTemp['default_status_add_product']['setting_value'] : '',
                    );
                    includeBlock('block/customComboboxBlock',$aStatusParams);
                ?>
            </div> 

            <div style="text-align: right;margin-top:10px;width:566px;">
                <button type="submit" class="flat_metro_button green_metro_style"><i class="fa fa-cog"></i> Update</button>
            </div>
        </form>
    </div>
</div>